<template>
<!--pages/serviceChooseStyle/serviceChooseStyle.wxml-->
<view class="container">
  <view class="good" v-for="(item, index) in list" :key="index">
    <image class="good-img" :src="item.goods_img"></image>
    <view class="good-right">
      <view class="good-right-name">{{item.goods_name}}</view>
      <view class="good-right-sku">{{item.sku_json_info.name?item.sku_json_info.name:''}}</view>
      <view class="good-right-price">￥{{item.price}}  x{{item.less_num}}</view>
    </view>
  </view>
  <view class="style" @tap="toDrawBack" data-index="1">
    <view class="style-left">
      <image class="style-left-icon" src="https://safood.supplyocta.com/Public/MallSmallApp/serviceDrawback.png"></image>
      <text class="style-left-name">我要退款</text>
    </view>
    <image class="style-right" src="/static/images/addRight.png"></image>
  </view>
  <view class="style" @tap="toDrawBack" data-index="2">
    <view class="style-left">
      <image class="style-left-icon" src="https://safood.supplyocta.com/Public/MallSmallApp/serviceDraw.png"></image>
      <text class="style-left-name">我要换货</text>
    </view>
    <image class="style-right" src="/static/images/addRight.png"></image>
  </view>
</view>
</template>

<script>

export default {
  data() {
    return {
      order_no: "",
      list: ""
    };
  },

  components: {},
  props: {},
  onLoad: function (options) {
    var order_no = options.order_no;
    var list = JSON.parse(options.list);
    this.setData({
      order_no,
      list
    });
  },
  methods: {
    toDrawBack(e) {
      var that = this;
      var type = e.currentTarget.dataset.index;
      uni.navigateTo({
        url: '../../mine/serviceSubmit/serviceSubmit?type=' + type + "&order_no=" + that.order_no + "&list=" + JSON.stringify(that.list)
      });
    }

  }
};
</script>
<style>
@import "./serviceChooseStyle.css";
</style>